<?php
namespace app\message\model;
use app\common\model\Common;
class Message extends Common
{
	protected $table = 'mps_message';
	protected $export_field = ['message_name','message_content'];

	/**
	* 导入
	*/
	public function exportData($data, $ty, $type)
	{
		foreach($data as $k => $v){
			$arr = [];
			foreach($this->export_field as $key => $val){
				$arr[$val] = str_replace(["\r","\n"], '', $v[$key]);
				$arr['type'] = $type;
			}
			$res = $this->isUpdate(false)->validate('Message.ajax')->save($arr);
			if($res === false){
				return false;
			}
		}
	}
}